﻿using SqlSugar;
using System;
using System.Configuration;

namespace Raffles.OA.Data
{
    public class ReportDB
    { 
        public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
        {
            ConnectionString = ConfigurationManager.ConnectionStrings["ReportDB"].ConnectionString,
            DbType = DbType.SqlServer,
            IsAutoCloseConnection = true,
            InitKeyType = InitKeyType.Attribute
        },
        db => { 
            db.Aop.OnLogExecuting = (sql, pars) =>
            {
                Console.WriteLine(sql);
            }; 
        });
    }
}